package com.sysu.ooad.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.sysu.ooad.dao.CourseDao;
import com.sysu.ooad.entity.Course;
import com.sysu.ooad.entity.Student;
import com.sysu.ooad.service.CourseService;

@Component("courseService")
public class CourseServiceImpl implements CourseService {

	private CourseDao courseDao;
	public CourseDao getCourseDao() {
		return courseDao;
	}
	@Resource
	public void setCourseDao(CourseDao courseDao) {
		this.courseDao = courseDao;
	}

	public List<Student> fingStudents(Course c) {
		return courseDao.findStudents(c);
	}
	
	public void lock(Course c, boolean locked) {
		c.setLocked(locked);
		courseDao.update(c);
	}
	
	public Course findById(Integer id) {
		return null;
	}
}
